LOCAL_DIR := $(shell pwd)
NDK_PATH := $(LOCAL_DIR)/../..
include $(NDK_PATH)/code/mediaserver/OSTYPE.param
include $(NDK_PATH)/Makefile.param

.PHONY:all  comm mapi vcap vcap_adpt vproc venc disp acap aenc adec ao msg base adapt config log osd vgs clean

all:  comm mapi vcap vcap_adpt vproc venc disp acap aenc adec ao msg base adapt config log osd vgs

comm:
	@cd comm; make

vcap:
	@cd vcap; make

vproc:
	@cd vproc; make

venc:
	@cd venc; make

aenc:
	@cd aenc; make

adec:
	@cd adec; make

ao:
	@cd ao; make

disp:
	@cd disp; make

acap:
	@cd acap; make

config:
	@cd configs; make

msg:
ifeq ($(MAPI_CPU_TYPE), dual)
	@cd msg; make
endif

log:
	@cd log; make

osd:
	@cd osd; make

vgs:
	@cd vgs; make

MAPI_INCS := $(wildcard $(NDK_PATH)/code/include/*.h)
MAPI_INCS := $(notdir $(MAPI_INCS))


mapi:
	@mkdir -p $(REL_INC)
	@cd ../include; cp $(MAPI_INCS) $(REL_INC);cd -
	@cp  $(NDK_PATH)/code/mediaserver/comm/arch/$(HIARCH)/*.h  $(REL_INC)
	@cp  $(NDK_PATH)/code/mediaserver/acap/arch/$(HIARCH)/*.h  $(REL_INC)
	@cp  $(NDK_PATH)/code/mediaserver/ao/arch/$(HIARCH)/*.h  $(REL_INC)
	@cp  $(NDK_PATH)/code/mediaserver/disp/arch/$(HIARCH)/*.h  $(REL_INC)
	@cp  $(NDK_PATH)/code/mediaserver/venc/arch/$(HIARCH)/*.h  $(REL_INC)
	@cp  $(NDK_PATH)/code/mediaserver/configs/sensor/$(HIARCH)/include/*.h  $(REL_INC)
clean:
	@cd comm; make clean
	@cd vcap; make clean
	@cd vproc; make clean
	@cd venc; make clean
	@cd aenc; make clean
	@cd adec; make clean
	@cd ao; make clean
	@cd acap; make clean
	@cd disp; make clean
	@cd configs; make clean
	@cd osd; make clean
	@cd vgs; make clean
ifeq ($(MAPI_CPU_TYPE), dual)
	@cd msg; make clean
endif
	@cd log; make clean
